<?php

require_once '../include.php';

use sdk\WeiXin;

$swx = new WeiXin($serverAppName, $serverAppId, $serverAppSecret);

$cwx = new WeiXin($customerAppName, $customerAppId, $customerAppSecret);

//$res = $swx->processEventKey('scan', '1234322');
//
//echo 'shop_id: ' . $res['shop_id'];
//
//echo 'role_id: ' . $res['role'];
//
//echo 'service_id: ' . $res['service_id'];

$param = array('touser' => 'oZzFPszkjkrwU0-b9JcP-M8UBVjE',
            'template_id' => 'EhuPn824rvGmAbp3xTs3SqiJHzP6SxGDH_q8hoQbY08',
            'url' => 'http://wx.hui-dian.cn/shop.php',
            'data' => array(
                'first' => array (
                    'value' => '您已下单成功',
                    'color' => '#000000'
                ),
                'keyword1' => array (
                    'value' => '美甲',
                    'color' => '#000000'
                ),
                'keyword2' => array (
                    'value' => '您已下单成功',
                    'color' => '#000000'
                ),
                'keyword3' => array (
                    'value' => '1小时',
                    'color' => '#000000'
                ),
                'keyword4' => array (
                    'value' => '100元',
                    'color' => '#000000'
                ),
                'remark' => array (
                    'value' => '加油！',
                    'color' => '#000000'
                )            
            ));

//echo $swx->sendTemplateMessage($param);
